<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight.erl</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Erlang) - Theme (Breeze Dark)"/>
</head><body style="background-color:#232629;color:#cfcfc2"><pre>
<span style="color:#7a7c7d;">% testing for the erlang syntax highlighter</span>
<span style="color:#7a7c7d;">% </span><span style="color:#81ca2d;background-color:#4d1f24;font-weight:bold;">NOTE</span><span style="color:#7a7c7d;"> alerts work in comments to </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold;">TODO</span><span style="color:#7a7c7d;"> !</span>

<span style="color:#7a7c7d;">% pragmas (show as keywords)</span>
<span style="font-weight:bold;">-module</span>
<span style="font-weight:bold;">-export</span>
<span style="font-weight:bold;">-define</span>
<span style="font-weight:bold;">-undef</span>
<span style="font-weight:bold;">-ifdef</span>
<span style="font-weight:bold;">-ifndef</span>
<span style="font-weight:bold;">-else</span>
<span style="font-weight:bold;">-endif</span>
<span style="font-weight:bold;">-include</span>
<span style="font-weight:bold;">-include</span>_lib

<span style="color:#7a7c7d;">% key words</span>
<span style="font-weight:bold;">after</span> <span style="font-weight:bold;">begin</span> <span style="font-weight:bold;">case</span> <span style="font-weight:bold;">catch</span> <span style="font-weight:bold;">cond</span>  <span style="font-weight:bold;">end</span> <span style="font-weight:bold;">fun</span> <span style="font-weight:bold;">if</span> <span style="font-weight:bold;">let</span> <span style="font-weight:bold;">of</span> <span style="font-weight:bold;">query</span> <span style="font-weight:bold;">receive</span> <span style="font-weight:bold;">all_true</span> <span style="font-weight:bold;">some_true</span> 

<span style="color:#7a7c7d;">% operators</span>
div rem or xor bor bxor bsl bsr and band not bnot
+ - * / == /= =:= =/= &lt; =&lt; &gt; &gt;= ++ -- = ! &lt;-

<span style="color:#7a7c7d;">% separators (show as functions)</span>
<span style="color:#8e44ad;">(</span> <span style="color:#8e44ad;">)</span> <span style="color:#8e44ad;">{</span> <span style="color:#8e44ad;">}</span> <span style="color:#8e44ad;">[</span> <span style="color:#8e44ad;">]</span> <span style="color:#8e44ad;">.</span> <span style="color:#8e44ad;">:</span> <span style="color:#8e44ad;">|</span> <span style="color:#8e44ad;">||</span> <span style="color:#8e44ad;">;</span> <span style="color:#8e44ad;">,</span> <span style="color:#8e44ad;">?</span> -&gt; <span style="color:#8e44ad;">#</span>

<span style="color:#7a7c7d;">% functions - predefined (part of erlang module) - show as functions</span>
<span style="color:#8e44ad;">abs</span> <span style="color:#8e44ad;">accept</span> <span style="color:#8e44ad;">alarm</span> <span style="color:#8e44ad;">apply</span> <span style="color:#8e44ad;">atom_to_list</span> <span style="color:#8e44ad;">binary_to_list</span> <span style="color:#8e44ad;">binary_to_term</span> <span style="color:#8e44ad;">check_process_code</span>
<span style="color:#8e44ad;">concat_binary</span> <span style="color:#8e44ad;">date</span> <span style="color:#8e44ad;">delete_module</span> <span style="color:#8e44ad;">disconnect_node</span> <span style="color:#8e44ad;">element</span> <span style="color:#8e44ad;">erase</span> <span style="color:#8e44ad;">exit</span> <span style="color:#8e44ad;">float</span> <span style="color:#8e44ad;">float_to_list</span>
<span style="color:#8e44ad;">garbage_collect</span> <span style="color:#8e44ad;">get</span> <span style="color:#8e44ad;">get_keys</span> <span style="color:#8e44ad;">group_leader</span> <span style="color:#8e44ad;">halt</span> <span style="color:#8e44ad;">hd</span> <span style="color:#8e44ad;">integer_to_list</span> <span style="color:#8e44ad;">is_alive</span> <span style="color:#8e44ad;">is_atom</span> <span style="color:#8e44ad;">is_binary</span>
<span style="color:#8e44ad;">is_boolean</span> <span style="color:#8e44ad;">is_float</span> <span style="color:#8e44ad;">is_function</span> <span style="color:#8e44ad;">is_integer</span> <span style="color:#8e44ad;">is_list</span> <span style="color:#8e44ad;">is_number</span> <span style="color:#8e44ad;">is_pid</span> <span style="color:#8e44ad;">is_port</span> <span style="color:#8e44ad;">is_process_alive</span>
<span style="color:#8e44ad;">is_record</span> <span style="color:#8e44ad;">is_reference</span> <span style="color:#8e44ad;">is_tuple</span> <span style="color:#8e44ad;">length</span> <span style="color:#8e44ad;">link</span> <span style="color:#8e44ad;">list_to_atom</span> <span style="color:#8e44ad;">list_to_binary</span> <span style="color:#8e44ad;">list_to_float</span> <span style="color:#8e44ad;">list_to_integer</span>
<span style="color:#8e44ad;">list_to_pid</span> <span style="color:#8e44ad;">list_to_tuple</span> <span style="color:#8e44ad;">load_module</span> <span style="color:#8e44ad;">loaded</span> <span style="color:#8e44ad;">localtime</span> <span style="color:#8e44ad;">make_ref</span> <span style="color:#8e44ad;">module_loaded</span> <span style="color:#8e44ad;">node</span> <span style="color:#8e44ad;">nodes</span> <span style="color:#8e44ad;">now</span>
<span style="color:#8e44ad;">open_port</span> <span style="color:#8e44ad;">pid_to_list</span> <span style="color:#8e44ad;">port_close</span> <span style="color:#8e44ad;">port_command</span> <span style="color:#8e44ad;">port_connect</span> <span style="color:#8e44ad;">port_control</span> <span style="color:#8e44ad;">ports</span> <span style="color:#8e44ad;">pre_loaded</span> <span style="color:#8e44ad;">process_flag</span>
<span style="color:#8e44ad;">process_info</span> <span style="color:#8e44ad;">processes</span> <span style="color:#8e44ad;">purge_module</span> <span style="color:#8e44ad;">put</span> <span style="color:#8e44ad;">register</span> <span style="color:#8e44ad;">registered</span> <span style="color:#8e44ad;">round</span> <span style="color:#8e44ad;">self</span> <span style="color:#8e44ad;">setelement</span> <span style="color:#8e44ad;">size</span>
<span style="color:#8e44ad;">spawn</span> <span style="color:#8e44ad;">spawn_link</span> <span style="color:#8e44ad;">spawn_opt</span> <span style="color:#8e44ad;">split_binary</span> <span style="color:#8e44ad;">statistics</span> <span style="color:#8e44ad;">term_to_binary</span> <span style="color:#8e44ad;">throw</span> <span style="color:#8e44ad;">time</span> <span style="color:#8e44ad;">tl</span> <span style="color:#8e44ad;">trunc</span> <span style="color:#8e44ad;">tuple_to_list</span>
<span style="color:#8e44ad;">unlink</span> <span style="color:#8e44ad;">unregister</span> <span style="color:#8e44ad;">whereis</span>

<span style="color:#7a7c7d;">% functions - inferred</span>
<span style="color:#8e44ad;">module:function</span>
<span style="color:#8e44ad;">function</span><span style="color:#8e44ad;">()</span>

<span style="color:#7a7c7d;">% atoms (show as &quot;char&quot;)</span>
<span style="color:#7a7c7d;">% begin with underscore, lowercase, contain numbers letters and @ - or anything between ''</span>
<span style="color:#3daee9;">middle_underscore</span>
<span style="color:#3daee9;">abc</span> <span style="color:#3daee9;">ab4d</span> <span style="color:#3daee9;">a@cd8</span> <span style="color:#3daee9;">a@</span>
<span style="color:#3daee9;">'And this is (\012) an atom \'</span> <span style="color:#27aeae;">Atoo</span><span style="color:#3daee9;">' Variable 'atom</span> <span style="color:#3daee9;">again' </span>

<span style="color:#7a7c7d;">% variables (begin with capital letter or underscore, contain numbers, letters and @)</span>
<span style="color:#27aeae;">_leadingUnderscore</span> <span style="color:#27aeae;">AbdD@</span> <span style="color:#27aeae;">B45@c</span>

<span style="color:#7a7c7d;">% this is a string </span>
<span style="color:#f44f4f;">&quot;a string sits between \&quot;</span> <span style="color:#3daee9;">double</span> <span style="color:#3daee9;">quotes</span><span style="color:#f44f4f;">&quot; atom &quot;</span><span style="color:#3daee9;">more</span> <span style="color:#3daee9;">string</span><span style="color:#f44f4f;">&quot;</span>

<span style="color:#7a7c7d;">% integers (decimal)</span>
<span style="color:#f67400;">1</span><span style="color:#8e44ad;">.</span> <span style="color:#f67400;">234</span> <span style="color:#f67400;">$A</span>

<span style="color:#7a7c7d;">% integers (specified base)</span>
<span style="color:#f67400;">2#10101</span> <span style="color:#f67400;">34#567</span>

<span style="color:#7a7c7d;">% float</span>
<span style="color:#f67400;">12.23</span> <span style="color:#f67400;">12.9e-67</span> <span style="color:#f67400;">12.8E+89</span> <span style="color:#f67400;">33.34e89</span>

<span style="color:#7a7c7d;">% and finally some real code, so we can see what it looks like...</span>
<span style="font-weight:bold;">-module</span><span style="color:#8e44ad;">(</span><span style="color:#3daee9;">codetest</span><span style="color:#8e44ad;">).</span>			<span style="color:#7a7c7d;">% everything is in a module</span>
<span style="font-weight:bold;">-export</span><span style="color:#8e44ad;">([</span><span style="color:#3daee9;">fac</span>/<span style="color:#f67400;">1</span><span style="color:#8e44ad;">]).</span>		<span style="color:#7a7c7d;">% name and number of arguments - need this to be called outside of the module</span>

<span style="color:#8e44ad;">fac</span><span style="color:#8e44ad;">(</span><span style="color:#27aeae;">N</span><span style="color:#8e44ad;">)</span> <span style="color:#3daee9;">when</span> <span style="color:#27aeae;">N</span> &gt; <span style="color:#f67400;">0</span>  -&gt; <span style="color:#27aeae;">N</span> * <span style="color:#8e44ad;">fac</span><span style="color:#8e44ad;">(</span><span style="color:#27aeae;">N</span>-<span style="color:#f67400;">1</span><span style="color:#8e44ad;">);</span>
<span style="color:#8e44ad;">fac</span><span style="color:#8e44ad;">(</span><span style="color:#27aeae;">N</span><span style="color:#8e44ad;">)</span> <span style="color:#3daee9;">when</span> <span style="color:#27aeae;">N</span> == <span style="color:#f67400;">0</span> -&gt; <span style="color:#f67400;">1</span><span style="color:#8e44ad;">.</span>
</pre></body></html>
